package com.jeff.tianti.cms.service;

import com.jeff.tianti.cms.entity.JobResumeMiddle;
import com.jeff.tianti.cms.dao.JobResumeMiddleDao;
import com.jeff.tianti.cms.dto.JobResumeMiddleQueryDTO;
import com.jeff.tianti.common.service.CommonService;
import com.jeff.tianti.common.entity.PageModel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author xujianfang
 * @desc JobResumeMiddleService�� 
 * @date 2019-07-17
 */
@Service
public class JobResumeMiddleService extends CommonService< JobResumeMiddle,String >  {

    @Autowired
    private JobResumeMiddleDao jobResumeMiddleDao;

    @Autowired
    public void setJobResumeMiddleDao(JobResumeMiddleDao jobResumeMiddleDao){
      super.setCommonDao(jobResumeMiddleDao);
    }

    public PageModel<JobResumeMiddle> queryJobResumeMiddlePage(JobResumeMiddleQueryDTO jobResumeMiddleQueryDTO){
           return this.jobResumeMiddleDao.queryJobResumeMiddlePage(jobResumeMiddleQueryDTO);
    }

    public List<JobResumeMiddle> queryJobResumeMiddleList(JobResumeMiddleQueryDTO jobResumeMiddleQueryDTO){
           return this.jobResumeMiddleDao.queryJobResumeMiddleList(jobResumeMiddleQueryDTO);
    }


    public Page<JobResumeMiddle> findJobResMeddleListById(String uid, Pageable pageable) {
        return this.jobResumeMiddleDao.findJobResMeddleListById(uid,pageable);
    }

    @Transactional
    public void deleteByJobIdAndUid(String id, String uid) {
        this.jobResumeMiddleDao.deleteByJobIdAndUid(id, uid);
    }

    public List<JobResumeMiddle> findByResumeIdAndJobId(String resumeId, String jobId) {
        return jobResumeMiddleDao.findByResumeIdAndJobId(resumeId, jobId);
    }
}